<?php
$pdf = Yii::createComponent('application.extensions.MPDF56.mpdf');
    $val=count($dataProvider);

    $html.=' <link rel="stylesheet" type="text/css" href="'.Yii::app()->request->baseUrl.'/css/pdf.css" />
<br>
    <table align="center"><tr>
    <td align="center" style="color:#0000FF"><b>Clientes</b></td>
    </tr></table>
    Total Resultados: '.$val.'
        <table>
        <thead>
            <tr>
                <td width="7%" style="color:#31B404">&nbsp;N° Cliente</td>
                <td width="7%" style="color:#31B404">&nbsp;Cedula</td>
                <td width="14%" style="color:#31B404">&nbsp;Nombre</td>
                <td width="14%" style="color:#31B404">&nbsp;Apellido</td>
                <td width="14%" style="color:#31B404">&nbsp;Teléfono</td>
                <td width="14%" style="color:#31B404">&nbsp;Dirección</td>
                <td width="14%" style="color:#31B404">&nbsp;Email</td>
                <td width="14%" style="color:#31B404">&nbsp;Estado</td>

            </tr></thead>';
         $i=0;
         
         while($i<$val){
            if ($dataProvider[$i]["ESTADO"]==1):
                    $a="Activo(a)";
            else:
                    $a="Inactivo(a)";
                endif;
$html.='
            <tr>
                <td width="7%">&nbsp;'.$dataProvider[$i]["ID"].'</td>
                <td width="19%">&nbsp;'.$dataProvider[$i]["IDCL"].'</td>
                <td width="19%">&nbsp;'.$dataProvider[$i]["NOMBRE"].'</td>    
                <td width="19%">&nbsp;'.$dataProvider[$i]["APELLIDO"].'</td>
                <td width="19%">&nbsp;'.$dataProvider[$i]["TELEFONO"].'</td>
                <td width="19%">&nbsp;'.$dataProvider[$i]["DIRECCION"].'</td>
                <td width="19%">&nbsp;'.$dataProvider[$i]["EMAIL"].'</td>
                <td width="19%">&nbsp;'.$a.'</td>
    ';
    $html.='</tr>'; $i++;
                        }
    $html.='</table>';


$header='<img src="'.'images/logo.png"/> ';

$mpdf=new mPDF('win-1252','LETTER','','',10,10,25,12,5,7);
$mpdf->SetHTMLHeader($header);
$mpdf->SetFooter(' {DATE j/m/Y}|Página {PAGENO}|');
$mpdf->WriteHTML($html);
$mpdf->Output();
exit;
?>